﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Flow_GetStepRightToFinish]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Flow_GetStepRightToFinish];
GO
CREATE PROCEDURE [dbo].[sproc_Flow_GetStepRightToFinish]
    @FlowID int,
    @StepID    int
AS
DECLARE @RightToFinish int

SET     @RightToFinish    = -1
SELECT     @RightToFinish    = RightToFinish
    FROM
        uds_flow_step
    WHERE
        flow_id     = @FlowID
        and step_id     = @StepID
        
RETURN  @RightToFinish